<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>服务站管理</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="refresh" content="1200">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=86e2297f">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=222aea35">
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <style>
        [v-cloak] {
            display: none;
        }

        .selectOption {
            margin-right: 20px;
        }

        .selectOption span {
            color: rgb(34, 139, 238);
            font-weight: bold;
            cursor: pointer;
        }

        .content {
            padding: 5px 8px 0px 8px;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            outline: none;
        }

        .td-value span.lineOne {
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            color: #333 !important;
            text-align: left !important;
        }

        .td-value {
            text-align: center !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: black !important;
        }

        .td-value span {
            overflow: hidden;
            padding-left: 0.06rem;
            word-wrap: break-word;
            color: black !important;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .fixed-table_body tr td {
            border-right: none;
            font-size: 12px;
            text-align: center;
        }

        .fixed-table_header tr th {
            border-right: none;
            background: yellow;
            font-weight: normal;
            font-size: 12px;
        }

        .fixed-table_body tr:nth-of-type(even) {
            background: #F9F9F9;
        }

        .slide-box {
            display: -webkit-box;
            -webkit-overflow-scrolling: touch;
            height: 34px;
            line-height: 34px;
            /*background: #2a8cec;*/
            width: 100%;
            padding-left: 5px;
            border-bottom: 1px solid #2a8cec;
        }

        .rights {
            text-align: center;
            color: #000;
            font-size: 14px;
            margin-left: 10px;
            margin-right: 4px;
            margin-top: 3px;
            cursor: pointer;
        }

        .lefts {
            text-align: center;
            color: #2a8cec;
            margin-left: 8px;
            margin-right: 8px;
            padding: 4px 15px 5px 15px;
            border: 1px solid #2a8cec;
            border-bottom: none;
            background: #fff;
            z-index: 999;
        }

        .slide-box1 {
            display: -webkit-box;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
            height: 30px;
        }

        .right {
            text-align: center;
            color: #666666;
            font-size: 12px;
            margin-left: 4px;
            margin-right: 4px;
            padding-top: 10px;
            padding-bottom: 5px;
            cursor: pointer;

        }

        .left {
            text-align: center;
            color: #228bee;
            /*border-bottom: 2px solid #228bee;*/
            margin-left: 8px;
            margin-right: 8px;
            padding-bottom: 5px;
        }

        .tryStyle {
            width: 34px;
            height: 17px;
            line-height: 17px;
            font-size: 12px;
            top: -1px;
            right: -10px;
            position: absolute;
            border-radius: 50px;
            margin-top: 4px;
            background: #FF0000;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.7);
            text-align: center !important;
        }

        .userName {
            text-align: justify;
            display: inline-block;
            overflow: hidden;
            vertical-align: middle;
            height: 24px;
            line-height: 24px;
            width: 40px;
        }

        .userName:after {
            content: " ";
            display: inline-block;
            width: 100%;
        }

        .input-sm {
            border-radius: 0;
            border: 1px solid #d2d6de;
            width: 120px;
            height: 25px;
            margin-right: 10px;
            size: 12;
        }

        .form-control {
            display: block;
            color: rgb(85, 85, 85);
            background-color: rgb(255, 255, 255);
            background-image: none;
            padding: 6px 12px;
            border-width: 1px;
            border-style: solid;
            border-image: initial;
            width: 120px;
            height: 25px;
            border: 1px solid #d2d6de;
            margin-right: 10px;
            padding-top: 0px;
            padding-bottom: 0px;
            padding-left: 6px;
            font-size: 12px;
            line-height: 25px;
            transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
        }

        input[type=button] {
            height: 25px;
        }

        .userName {
            text-align: justify !important;
            display: inline-block !important;
            overflow: hidden !important;
            vertical-align: middle !important;
            height: 24px !important;
            line-height: 24px !important;
            width: 46px !important;
        }

        .userName:after {
            content: " ";
            display: inline-block;
            width: 100%;
        }

    </style>
</head>
<body>
<iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div class="nav-tabs-custom oaReportNav" style="margin:10px 0px;">
        <div class="pull-left">
            <select v-model="searchParams.companyId" class="form-control">
                <option value="" selected="selected">所属公司</option>
                <option v-for="company in companyList" v-bind:value="company.id">{{company.name}}</option>
            </select>
        </div>
        <button type="button" class="btn oaBtn btn-sm pull-left" @click="getList()"
                style="margin-left: 10px; min-width: 10px; width: 50px;">
            查询
        </button>
        <div class="has-feedback">
            <input type="button" class="btn oaBtn pull-left btn-sm" style="margin-right: 10px;float: right !important;"
                   value="新增服务站"
                   class="oaBtn" @click="addCustomer()">
        </div>

    </div>
    <div class="box-body no-padding" style="overflow: auto;margin-top:10px;display: inline-block; ">
        <div class="fixed-table-box head-fixed ">
            <div class="fixed-table_header-wraper">
                <table class="fixed-table_header " cellspacing="0" cellpadding="0" border="0">
                    <thead>
                    <tr>
                        <th style="width:240px">
                            <div class="table-cells">公司</div>
                        </th>
                        <th style="width:80px">
                            <div class="table-cells">服务站</div>
                        </th>
                        <th style="width:150px">
                            <div class="table-cells">人数</div>
                        </th>
                        <th style="width:80px">
                            <div class="table-cells">创建人</div>
                        </th>
                        <th>
                            <div class="table-cells">创建时间</div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
            <div class="fixed-table_body-wraper iframePhoneFixed" id="scrollDiv">
                <table class="fixed-table_body table-hover" cellspacing="0" cellpadding="0" border="0"
                       style="width: 100%;">
                    <tbody>
                    <tr v-for="(item,i) in list">
                        <td style="width:240px">{{item.companyName}}</td>
                        <td style="width:80px;color: rgb(42, 140, 236); cursor: pointer;"
                            @click="getDetail(item.stationId)">
                            {{item.stationName}}
                        </td>
                        <td style="width:150px">{{item.peopleNum}}</td>
                        <td style="width:80px"><span class="userName">{{item.createUserName}}</span></td>
                        <td>{{item.createTime}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="oa-pager text-center" style="margin-top: 5px;">
            共
            <span id="allCount"> 0 </span>条记录&nbsp;&nbsp;&nbsp;
            <span id="nowPage"> 1 </span>/<span id="allPage">1</span>&nbsp;&nbsp;&nbsp;
            <span class="oa-pager-button" id="first">首页</span>
            <span class="oa-pager-button" id="prev">上一页</span>
            <span class="oa-pager-button" id="next">下一页</span>
            <span class="oa-pager-button" id="last">尾页</span>
        </div>
    </div>
    <!-- /.box-body -->
</section>
<!--JQ-->
<!--插件JS-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<script>window.jQuery || document.write('<script src="/dist/plugins/jQuery/jquery-2.2.3.min.js"><\/script>', '<script src="/dist/plugins/bootstrap/js/bootstrap.min.js"><\/script>', '<script src="/dist/plugins/vue/vue.min.js"><\/script>')</script>
<script src="/dist/plugins/jQuery/jquery.cookie.min.js"></script>
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/fixedTable/fixed-table.js"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                var width = $(this).outerWidth();
                if (width < 180) {
                    width = 180;
                }
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": width + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">

    function refresh() {
        window.location.href = "callList.html";
    }

    var app = new Vue({
        el: '#app',
        data: {
            list: [],
            searchParams: {
                key: '',
                companyId: '',
            },
            itemCallType: [],
            itemCustomerType: [],
            companyList: [],
        },
        methods: {
            formatDate: function (now) {
                return NewDate(now).Format(TimeFormat.pcList);
            },
            getCompanyList: function () {
                var that = this;
                $.wyui.postMethod("/company/getCompanyList.json", {}, function (data) {
                    that.companyList = data;
                });
            },
            getDetail: function (staId) {
                var that = this;
                top.$.dialog({
                    content: 'url:/page/serve/serviceStationDetail.html?pageType=edit&id=' + staId,
                    title: "服务站维护",
                    width: 400,
                    height: 500,
                    max: true,
                    min: true,
                    lock: true
                });
            },
            getList: function () {
                $.extend($.wyui.page.queryParams, trimRN(this.searchParams));
                $.wyui.page.queryParams.requestPage = 1;
                $.wyui.page.queryParams.pageSize = 30;
                $.wyui.page.getByPage();
            },
            updateStationList: function () {
                var that = this;
                $.wyui.postMethod("/serveStation/getServeStationList.json", {companyId: this.params.companyId}, function (data) {
                    that.stationList = data.records;
                });
            },
            addCustomer: function () {
                top.$.dialog({
                    content: 'url:/page/serve/serviceStationDetail.html?pageType=edit',
                    title: "新增服务站",
                    width: 400,
                    height: 500,
                    max: true,
                    min: true,
                    lock: true
                });
            }
        },
        mounted: function () {
            var that = this;
            $.extend($.wyui.page.queryParams, trimRN(this.searchParams));
            $.wyui.page.dataUrl = server.ip + "/serveStation/getServeStationList.json";
            that.getCompanyList();
        },

    });
</script>
<script>
    /************************滚动加载******************************/
    var divscroll = document.getElementById('scrollDiv');

    function divScroll() {
        var wholeHeight = divscroll.scrollHeight;
        var scrollTop = divscroll.scrollTop;
        var divHeight = divscroll.clientHeight;
        if (scrollTop + divHeight >= wholeHeight - 2) {
//            alert('滚动到底部了！');
            if (isLoad) {
                isLoad = false;
                setTimeout($.wyui.page.getByPage("scroll"), 1000);
            }
            //这里写动态加载的逻辑，比如Ajax请求后端返回下一个页面的内容
        }
    }

    divscroll.onscroll = divScroll;
</script>
<script>


    $.wyui.page.getByPage_callback = function () {
    };
    $.wyui.page.getByPage_scroll_callback = function (data) {
        if (data.length < $.wyui.page.queryParams.pageSize) {
            sLoad = false;
        } else {
            app.list = app.list.concat(data);
            isLoad = true;
        }
    }
    $.wyui.page.getByPage_callback_new = function (r) {
        app.list = r.records;
        console.log(app.list);
    };
</script>
<script>
    //初始化FixedTable
    $(".fixed-table-box").fixedTable();
</script>
</body>
</html>